<template>
  <el-dialog
    @close="closeFn"
    :title="title"
    :visible="dialogVisible"
    :width="width"
  >
    <slot></slot>
    <span slot="footer" class="dialog-footer">
      <slot name="footer"></slot>
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "请输入标题",
    },
    dialogVisible: {
      type: Boolean,
      default: false,
    },
    width: {
      type: String,
      default: "30%",
    },
  },
  methods: {
    closeFn() {
      this.$emit("EventClose", false);
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep .el-dialog__header {
  border-bottom: 1px solid #ccc;
}
</style>